<template>
  <el-row>
    <settingInfo
        @getOptionSuccess="getOptionSuccess"
        v-show="currTabNum===1"/>
    <systemSetting
        :districtOptions="districtOptions"
        :freqCategoryOptions="freqCategoryOptions"
        v-show="currTabNum===2"/>
  </el-row>
</template>

<script>
// -------------- 自定义组件 ---------------
import settingInfo from "./settingInfo";
import systemSetting from "./systemSetting";

export default {
  components: {
    settingInfo, systemSetting
  },
  props: {
    currTabNum: {
      type: Number,
      default: 1
    },
  },
  data() {
    return {
      districtOptions: [],
      freqCategoryOptions: [],
      mobileOptions: [],
      monitorOptions: [],
      taizhanOptions: []
    }
  },
  methods: {
    /**
     * 下拉框选项
     * @param val
     */
    getOptionSuccess: function (val) {
      this.districtOptions = val.district;
      this.freqCategoryOptions = val.freqCategory;
      this.freqCategoryOptions.unshift({value: 0, label: "全部"})
      this.mobileOptions = val.mobile;
      this.monitorOptions = val.monitor;
      this.taizhanOptions = val.taizhan;
    }
  }
}
</script>

<style scoped>

</style>